cmake_minimum_required(VERSION 2.6)

add_definitions(
  -D_GNU_SOURCE
  -DHAVE_CONFIG_H
)

set(GST_VERSION_MICRO 2)
set(GST_VERSION_NANO 0)
set(VERSION ${GST_MAJORMINOR}.${GST_VERSION_MICRO})
set(PACKAGE "gst-plugins-good")
set(PACKAGE_NAME "GStreamer Good Plugins")
set(PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer")
set(PACKAGE_STRING "${PACKAGE_NAME} ${VERSION}")
set(PACKAGE_TARNAME ${PACKAGE})
set(PACKAGE_VERSION ${VERSION})
set(GETTEXT_PACKAGE "${PACKAGE}-${GST_MAJORMINOR}")

# Optional dependencies
find_library(AALIB_LIBRARIES aa)
find_path(AALIB_INCLUDE_DIRS aalib.h)
find_library(JPEG_LIBRARIES jpeg)
find_path(JPEG_INCLUDE_DIRS jconfig.h)

pkg_check_modules(CAIRO cairo>=1.0.0)
pkg_check_modules(LIBDV libdv>=0.100)
pkg_check_modules(ESOUND esound>=0.2.12)
pkg_check_modules(FLAC flac>=1.1.4)
pkg_check_modules(LIBGCONF gconf-2.0)
pkg_check_modules(GDKPIXBUF gdk-pixbuf-2.0>=2.8.0)
pkg_check_modules(HAL hal>=0.5.6 dbus-1>=0.32)
pkg_check_modules(CACA caca)
pkg_check_modules(PNG libpng>=1.2)
pkg_check_modules(CACA caca)
pkg_check_modules(PULSE libpulse>=0.9.10)
pkg_check_modules(PULSE_0_9_11 libpulse>=0.9.11)
pkg_check_modules(PULSE_0_9_12 libpulse>=0.9.12)
pkg_check_modules(PULSE_0_9_13 libpulse>=0.9.13)
pkg_check_modules(PULSE_0_9_15 libpulse>=0.9.15)
pkg_check_modules(PULSE_0_9_20 libpulse>=0.9.20)
pkg_check_modules(RAW1394 libraw1394>=1.2.1)
pkg_check_modules(AVC1394 libavc1394)
pkg_check_modules(LIBIEC61883 libiec61883>=1.0.0)
pkg_check_modules(SHOUT2 shout>=2.0)
pkg_check_modules(SOUP libsoup-gnome-2.4>=2.3.2)
pkg_check_modules(TAGLIB taglib>=1.5)
pkg_check_modules(WAVPACK wavpack>=4.40.0)

# Rename these variables for the config.h
redefine(PULSE_FOUND HAVE_PULSE)
redefine(PULSE_0_9_11_FOUND HAVE_PULSE_0_9_11)
redefine(PULSE_0_9_12_FOUND HAVE_PULSE_0_9_12)
redefine(PULSE_0_9_13_FOUND HAVE_PULSE_0_9_13)
redefine(PULSE_0_9_15_FOUND HAVE_PULSE_0_9_15)
redefine(PULSE_0_9_20_FOUND HAVE_PULSE_0_9_20)


include_directories(${CMAKE_BINARY_DIR}/include/gstreamer-${GST_MAJORMINOR})
include_directories(${CMAKE_SOURCE_DIR}/gstreamer-0.10.29/gst)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/gst-libs)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/gst-libs)

include_directories(${GLIB_INCLUDE_DIRS})
include_directories(${GMODULE_INCLUDE_DIRS})
include_directories(${LIBXML_INCLUDE_DIRS})

configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
  ${CMAKE_CURRENT_BINARY_DIR}/config.h
)

configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/_stdint.h.in
  ${CMAKE_CURRENT_BINARY_DIR}/_stdint.h
)

add_subdirectory(gst/alpha)
add_subdirectory(gst/apetag)
add_subdirectory(gst/audiofx)
add_subdirectory(gst/audioparsers)
add_subdirectory(gst/auparse)
add_subdirectory(gst/autodetect)
add_subdirectory(gst/avi)
add_subdirectory(gst/cutter)
add_subdirectory(gst/debugutils)
#add_subdirectory(gst/deinterlace)
add_subdirectory(gst/effectv)
add_subdirectory(gst/equalizer)
add_subdirectory(gst/flv)
#add_subdirectory(gst/flx)
add_subdirectory(gst/goom)
add_subdirectory(gst/goom2k1)
add_subdirectory(gst/icydemux)
add_subdirectory(gst/id3demux)
#add_subdirectory(gst/interleave)
add_subdirectory(gst/imagefreeze)
add_subdirectory(gst/isomp4)
add_subdirectory(gst/law)
add_subdirectory(gst/level)
add_subdirectory(gst/matroska)
add_subdirectory(gst/monoscope)
add_subdirectory(gst/multifile)
add_subdirectory(gst/multipart)
add_subdirectory(gst/replaygain)
add_subdirectory(gst/rtp)
add_subdirectory(gst/rtpmanager)
add_subdirectory(gst/rtsp)
add_subdirectory(gst/shapewipe)
#add_subdirectory(gst/smpte)
add_subdirectory(gst/spectrum)
add_subdirectory(gst/udp)
#add_subdirectory(gst/videobox)
add_subdirectory(gst/videocrop)
add_subdirectory(gst/videofilter)
add_subdirectory(gst/videomixer)
add_subdirectory(gst/wavenc)
add_subdirectory(gst/wavparse)
add_subdirectory(gst/y4m)
add_subdirectory(ext/aalib)
add_subdirectory(ext/annodex)
#add_subdirectory(ext/cairo)
add_subdirectory(ext/dv)
add_subdirectory(ext/flac)
#add_subdirectory(ext/gdk_pixbuf)
add_subdirectory(ext/jack)
add_subdirectory(ext/jpeg)
add_subdirectory(ext/libcaca)
add_subdirectory(ext/libpng)
add_subdirectory(ext/pulse)
#add_subdirectory(ext/raw1394)
add_subdirectory(ext/shout2)
add_subdirectory(ext/soup)
if(SPEEX_FOUND)
  add_subdirectory(ext/speex)
endif()
add_subdirectory(ext/taglib)
add_subdirectory(ext/wavpack)

